package UIlayer;
import java.util.Scanner;
import java.io.*;
import java.net.URISyntaxException;
import java.net.URL;

/**
 * Write a description of class Scan here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Scan
{
    private static Scanner scanner;

    /**
     * Constructor for objects of class Scan
     */
    public Scan()
    {
    }

    public static Scanner getInstance()
    {
        if(scanner == null)
        {
            scanner = new Scanner(System.in);
        }
        return scanner;
    }

    public static Scanner getInstance(File file)
    {
        if(scanner == null)
        {
            try
            {
                scanner = new Scanner(file);
            }
            catch(FileNotFoundException e)
            {
                System.out.println("file");
            }
        }
        return scanner;
    }
}
